<%@ page import="coe.pumbaa.Post" %>
<!doctype html>
<html>
  <head>
    <meta name="layout" content="PumbaaLayout">
  <g:set var="entityName" value="${message(code: 'post.label', default: 'Post')}" />
  <title>Create Post</title>
</head>
<body>
  <section id="main" class="column">
    <g:hasErrors bean="${postInstance}">
      <ul class="errors" role="alert">
        <g:eachError bean="${postInstance}" var="error">
          <li><g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
        </g:eachError>
      </ul>
    </g:hasErrors>
    <pumbaa:alert />
    <article class="module width_full">
      <header><h3>Edit post</h3></header>
      <g:form  name="postForm" action="update" method="POST">
        <input type="hidden" name="id" value="${postInstance?.id}"/>
        <input type="hidden" name="catID" value="${postInstance?.category?.id}"/>
        <div class="module_content">
          <g:render template="form"/>
          <div class="submit_link">
            <g:submitButton class="alt_btn" name="submit" value="Save"/>
          </div>
        </div>
        <div class="clear"></div>
      </g:form>
    </article>
    <div class="spacer"></div>       
  </section>
</body>
</html>
